import jakarta.servlet.annotation.WebInitParam;
import java.io.*;
import jakarta.servlet.*;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.*;

@WebServlet(name="TestServlet03",urlPatterns = "/TestServlet03",
initParams = {@WebInitParam(name= "encoding",value="UTF-8"),})
public class TestServlet03 extends HttpServlet{
    protected void doGet(HttpServletRequest request,
                         HttpServletResponse response)throws ServletException,IOException{
        PrintWriter out=response.getWriter();
        ServletConfig config=this.getServletConfig();
        String param=config.getInitParameter("encoding");
        out.println("encoding="+param);
    }
    protected void doPost(HttpServletRequest request,
                          HttpServletResponse response)throws ServletException,IOException{
        this.doGet(request,response);
    }
}
